Adds Call Traces — per-turn STT/LLM/TTS latency for voice agent calls. - #123
Adds Call Traces — per-turn STT/LLM/TTS latency for voice agent calls.#123MSami625 wants to merge 66 commits into
Conversation
…3 artifacts on preview
…and actor stamping
…oved task dispatching
…ics across services
… for usage features
…tion in Docker and API
…rocess_evaluator_result.py
…ing and cache/Ui fixes
…r available models
…iguration for periodic job scheduling
…n events and audio billing; enhance CSP policy for frame sources
…API routes and services;
…g evaluator result creation and usage tracking;
…oducing patching for blob storage and integrating new storage stubs
…processing; improve error handling during database commits
…call usage tracking; update test to reflect new behavior
… tests; update configuration and service logic to prevent external API calls
… conversation tracking in test agents and voice agents
…and update configuration for Flexprice setup
…icense features to canonical meters with dry-run option
…ribe functionality and updating configuration options
…pt partial AI assistance, enhancing tracking for generated prompts and scenarios
…information and updating event handling for playground calls and fix sarvam ai flooding logs
…tes, enhancing telemetry capabilities
|
| Filename | Overview |
|---|---|
| app/api/v1/routes/observability.py | Adds call-detail and provider-ingestion behavior, but the provider webhook upsert can mutate and return a sibling-workspace record because its lookup omits workspace scope. |
| app/api/v1/routes/synthetic_traces.py | Adds authenticated, workspace-scoped trace session, ingest, listing, correlation, and detail endpoints; the previously reported backfill route now supplies the active workspace. |
| app/services/synthetic_traces/trace_service.py | Implements trace creation, correlation, backfill, span ingestion, turn derivation, and finalization, with the normal backfill selection now scoped by organization and workspace. |
| app/services/voice_agent/playground_tracing.py | Initializes one in-process exporter and stamps each playground call's organization, workspace, and call identifiers into its spans, resolving the prior mutable-exporter correlation issue. |
| app/services/synthetic_traces/internal_otlp_exporter.py | Groups exported spans by their own organization, workspace, and call attributes rather than mutable per-call exporter state. |
| app/migrations/078_synthetic_call_traces.py | Adds persistence structures for trace headers, turn payloads, and OTLP payloads. |
| frontend/src/components/call-recordings/SyntheticCallTracePanel.tsx | Adds the primary call-trace presentation panel integrating latency summaries and detailed trace views. |
Reviews (3): Last reviewed commit: "chore: remove Confluence scratch files a..." | Re-trigger Greptile
…ll recording source and audio streaming capabilities
…nd routes enhancing performance and maintainability
…in span correlation and improve span grouping logic
Integrate simulation upgrades, evaluator results dashboard, persona ambient noise, and test-agent playground UX with synthetic call traces, OTLP ingestion, and unified call recording panels. Preserves per-span tenant isolation for in-process playground telemetry export. Co-authored-by: Cursor <cursoragent@cursor.com>
Restores ListIntegrationVoiceAgentsResponse and IntegrationVoiceAgentListItem dropped during main merge so the API server can start. Co-authored-by: Cursor <cursoragent@cursor.com>
…-events Repair post-merge regressions: unified /calls routes, evaluator transcript resolution, trace lookup by call_short_id, live telephony SSE, playground re-evaluate, and full test-agent result details. Co-authored-by: Cursor <cursoragent@cursor.com>
…guard Delete tracked .tmp-* Confluence/MCP artifacts, gitignore future scratch files, restore skipped_playground webhook protection, and align observability list test with unified /calls hub behavior. Co-authored-by: Cursor <cursoragent@cursor.com>
| call_recording = ( | ||
| db.query(CallRecording) | ||
| .filter( | ||
| CallRecording.organization_id == organization_id, | ||
| CallRecording.provider_call_id == provider_call_id, | ||
| CallRecording.provider_platform == provider_platform, | ||
| ) | ||
| .first() | ||
| ) |
There was a problem hiding this comment.
Webhook crosses workspace boundary
When a webhook submits a provider platform and call ID matching a non-playground recording in another workspace of the same organization, this lookup selects that recording, overwrites its call data and lifecycle fields, and returns its call data to the webhook caller. Constrain the existing-record lookup to the workspace already resolved for this ingestion.
How this was verified: The webhook-supplied identifiers flow into an organization-only lookup whose matched record is mutated and serialized with include_data=True.
| call_recording = ( | |
| db.query(CallRecording) | |
| .filter( | |
| CallRecording.organization_id == organization_id, | |
| CallRecording.provider_call_id == provider_call_id, | |
| CallRecording.provider_platform == provider_platform, | |
| ) | |
| .first() | |
| ) | |
| call_recording = ( | |
| db.query(CallRecording) | |
| .filter( | |
| CallRecording.organization_id == organization_id, | |
| CallRecording.workspace_id == workspace_id, | |
| CallRecording.provider_call_id == provider_call_id, | |
| CallRecording.provider_platform == provider_platform, | |
| ) | |
| .first() | |
| ) |
Knowledge Base Used:
What Changed?
Adds Call Traces — per-turn STT/LLM/TTS latency for voice agent calls.
/api/v1/observability/tracesAPI (session create, OTLP ingest, list/detail, close)078_synthetic_call_traces)efficientai.integrations.efficientai_traces) for external botsWhy?
Reviewers need per-turn latency (STT / LLM / TTS) during playground runs, phone evals, and external Pipecat agents. This adds OTLP-based trace ingest correlated by
call_short_id, so latency is visible in one place in the UI.How to Test?
eai start-alland confirm migration078applied.docs/synthetic-call-traces-pipecat.md→ talk 2–3 turns → check Call Traces UI.uv run pytest tests/test_synthetic_trace_*.py tests/test_efficientai_traces_correlation.py tests/test_services/test_playground_tracing.py -qRelease Label
Select one semantic version bump intent for this PR:
major- breaking change, next release bumps major versionminor- backward-compatible feature, next release bumps minor versionfix- backward-compatible bug fix, next release bumps patch versionIntended release label:
minorChecklist
CONTRIBUTING.mdguide.